package com.haina.shop.mapper;

import com.haina.shop.domain.UserCollection;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
* @author 48077
* @description 针对表【tz_user_collection】的数据库操作Mapper
* @createDate 2024-07-31 18:34:30
* @Entity com.haina.shop.domain.UserCollection
*/
public interface UserCollectionMapper extends BaseMapper<UserCollection> {
    @Select("select  count(*) from tz_user_collection where prod_id=#{param1} and  user_id=#{param2}")
    int  isExists(Long prodId,Long userId);

@Delete("delete from tz_user_collection where prod_id =#{param1} and user_id=#{param2}")
    void deleteByProdId(Long prodId, Long userId);

    @Select("select count(*) from tz_user_collection where user_id=#{userId}")
    long selectByCount(String userId);
}




